Skip to content

fix: lint under GOOS=windows, bound junction path length#51

Merged
min0625 merged 1 commit into
mainfrom
fix/lint-goos-windows-junction-bounds
Jul 7, 2026
Merged

fix: lint under GOOS=windows, bound junction path length#51
min0625 merged 1 commit into
mainfrom
fix/lint-goos-windows-junction-bounds

Conversation

@min0625

@min0625 min0625 commented Jul 7, 2026

Copy link
Copy Markdown
Owner

Summary

  • make check/make fix now lint under both GOOS=linux and GOOS=windows, so build-tagged files like linkdir_windows.go stop being silently skipped on Linux CI/dev machines
  • Linting under Windows surfaced a real bug: setJunction built the reparse-point buffer from an unbounded target path, which can overflow the uint16 length fields and the kernel's MAXIMUM_REPARSE_DATA_BUFFER_SIZE cap — now bounds-checked with a clear error
  • Also tightens the junction dir mode to 0o755 (was 0o777) and adds a test covering parseSemver's malformed-tag rejection rules

Test plan

  • CI: make check (lint under linux + windows) and make test pass

…ion path length

`make check`/`make fix` only linted the host GOOS, so linkdir_windows.go
was silently skipped in CI on Linux. Running golangci-lint under both
linux and windows surfaced a real bug: setJunction built the reparse-point
buffer from an unbounded target path, which can overflow the uint16
length fields and the kernel's MAXIMUM_REPARSE_DATA_BUFFER_SIZE cap.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@qodo-code-review

Copy link
Copy Markdown

Qodo reviews are paused for this user.

Troubleshooting steps vary by plan Learn more →

On a Teams plan?
Reviews resume once this user has a paid seat and their Git account is linked in Qodo.
Link Git account →

Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center?
These require an Enterprise plan - Contact us
Contact us →

@codecov

codecov Bot commented Jul 7, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@min0625 min0625 merged commit 20cfba4 into main Jul 7, 2026
9 checks passed
@min0625 min0625 deleted the fix/lint-goos-windows-junction-bounds branch July 7, 2026 07:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant